Imports obout_ASPTreeView_Pro_NET
Imports ccapps.persistent.authorization
'Imports ccapps.persistent.laLocationDefine
Imports ccapps.persistent.common
Imports ccapps.persistent.RetantionActivate

Namespace Web.page

    Public Class RetentionWithMnpSupport_Sme_Gateway
        Inherits [lib].BasePage

#Region " Web Form Designer Generated Code "

        'This call is required by the Web Form Designer.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

        End Sub
        Protected WithEvents TreeView As System.Web.UI.WebControls.Literal
        Protected WithEvents chk_a0 As System.Web.UI.WebControls.CheckBox
        Protected WithEvents ltlAlert As System.Web.UI.WebControls.Literal
        Protected WithEvents Repeater1 As System.Web.UI.WebControls.Repeater
        Protected WithEvents proc As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents userid As System.Web.UI.WebControls.TextBox
        Protected WithEvents username As System.Web.UI.WebControls.TextBox
        Protected WithEvents Txt1 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents custcode As System.Web.UI.WebControls.TextBox
        Protected WithEvents msisdn As System.Web.UI.WebControls.TextBox
        Protected WithEvents Lblok As System.Web.UI.WebControls.Label
        'NOTE: The following placeholder declaration is required by the Web Form Designer.
        'Do not delete or move it.
        Private designerPlaceholderDeclaration As System.Object

        Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            'CODEGEN: This method call is required by the Web Form Designer
            'Do not modify it using the code editor.
            InitializeComponent()
        End Sub

        Public Sub ASPNET_MsgBox(ByVal Message As String)

            System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=""JavaScript"">" & vbCrLf)

            System.Web.HttpContext.Current.Response.Write("alert(""" & Message & """)" & vbCrLf)

            System.Web.HttpContext.Current.Response.Write("</SCRIPT>")

        End Sub


#End Region
        '    Public ilk_internalID As Integer = 0
        Dim button_add As Integer

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

            If Not Page.IsPostBack Then
                If Request.QueryString("custcode") <> "" Then Me.custcode.Text = Request.QueryString("custcode")
            End If

            Me.PageTitle = "SME RETENTION CAMPAIGN"
            Me.HelpDocName = "retention.doc"
            ' default_tree()
            Dim customerCode As String = Me.custcode.Text.Trim
            Dim msisdn As String = Me.msisdn.Text.Trim
            Dim Vproc As String
            Vproc = Me.proc.Value
            Me.proc.Value = ""

            If Vproc <> "" And Me.custcode.Text = "" And Me.msisdn.Text = "" Then
                Message = "alert('CustomerCode veya msisdn girmelisiniz ! ')"
                Exit Sub
            End If

            If Vproc <> "" Then
                Dim sql As String
                Dim temp As DataTable

                If Me.msisdn.Text <> "" Then
                    temp = msisdnTOcustcode(Me.msisdn.Text)
                    If temp.Rows().Count = 0 Then
                        Message = "alert('Bu MSISDN e ait sirket bulunamadi ! ')"
                        Exit Sub
                    Else
                        customerCode = temp.Rows(0)(0)
                    End If
                    'LOGLAMA
                    Dim log_query As String = "select *from dual"
                    persistent.myDBConn.ORAScalar_LOG(log_query, "", "", "", Me.msisdn.Text.Trim(), "Select(MSISDN)", "RetentionWithMnpSupport_Sme_Gateway", Session("user"))

                End If

                If customerCode <> "" Then
                    If (testMode = False) Then
                        If CustomerControlForSme(customerCode).Rows().Count = 0 Then
                            Message = "alert('CustomerCode bulunamadi, SME degil yada deaktif! ')"
                            Exit Sub
                        End If
                    End If
                    'LOGLAMA
                    Dim log_query As String = "select *from dual"

                    persistent.myDBConn.ORAScalar_LOG(log_query, "", "", "", Me.msisdn.Text.Trim(), "Select(Custcode)", "RetentionWithMnpSupport_Sme_Gateway", Session("user"))
                End If

            End If

            Select Case Vproc
                Case "devam"

                    Response.Redirect("RetentionWithMnpSupport_Sme_Workplace.aspx?custcode=" & customerCode & "&msisdn=" & msisdn)


            End Select

        End Sub

    End Class

End Namespace